package com.avic.modules.task.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;

/**
 * @author zhangzikang 健康等级评估
 * @date 2022-08-14
 */
@Data
@TableName("equip_ehr")
@NoArgsConstructor
public class EquipEhr {

    @TableId(value="ID", type = IdType.AUTO)
    private Long id;

    // 时间
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp time;

    // 设备id
    private String equipId;

    // 设备健康值
    private Integer ehr;

    public void copy(EquipEhr source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
